package com.atguigu.gulimall.auth.feign;

import com.atguigu.common.utils.R;
import com.atguigu.gulimall.auth.vo.SocialUser;
import com.atguigu.gulimall.auth.vo.UserLoginVo;
import com.atguigu.gulimall.auth.vo.UserRegistVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import javax.validation.Valid;

/**
 * 会员服务
 *
 * @author 47001
 */
@FeignClient("gulimall-member")
public interface MemberFeign {

    /**
     * 会员注册
     *
     * @param vo
     * @return
     */
    @PostMapping("/member/member/regist")
    R regist(@RequestBody @Valid UserRegistVo vo);

    /**
     * 用户登录
     *
     * @param vo
     * @return
     */
    @PostMapping("/member/member/login")
    R login(@RequestBody UserLoginVo vo);

    /**
     * 社交用户登录
     *
     * @param vo
     * @return
     */
    @PostMapping("/member/member/oauth2/login")
    R oauth2Login(@RequestBody SocialUser vo);
}
